<!DOCTYPE HTML>
<html>
	<head>
		<title>index</title>
		<link rel="stylesheet" href="yzm/jquery.idcode.css" />
		<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
		<link rel="stylesheet" href="css/login.css" />
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/validator.js"></script>
		<script src="bootstrap/js/bootstrap.min.js"></script>
		<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all">
		<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="application/x-javascript">
			addEventListener("load", function() {
				setTimeout(hideURLbar, 0);
			}, false);

			function hideURLbar() {
				window.scrollTo(0, 1);
			}
		</script>
		<script src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/easing.js"></script>
		<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
		<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
		<link href="css/form.css" rel="stylesheet" type="text/css" media="all" />
		<script type="text/javascript" src="js/megamenu.js"></script>
		<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
		
		<script src="js/jquery.easydropdown.js"></script>
		<script src="js/jquery.etalage.min.js"></script>
				<script>

			$(document).ready(function() {
				//打开会员登录 
				$("#Login_start_").click(function() {
					$("#regist_container").hide();
					$("#_close").show();
					$("#_start").animate({
						left: '350px',
						height: '520px',
						width: '400px'
					}, 500, function() {
						$("#login_container").show(500);
						$("#_close").animate({
							height: '40px',
							width: '40px'
						}, 500);
					});
				});
				//打开会员注册
				$("#Regist_start_").click(function() {
					$("#login_container").hide();
					$("#_close").show();
					$("#_start").animate({
						left: '350px',
						height: '520px',
						width: '400px'
					}, 500, function() {
						$("#regist_container").show(500);
						$("#_close").animate({
							height: '40px',
							width: '40px'
						}, 500);
					});
				});
				//关闭
				$("#_close").click(function() {
					
					$("#_close").animate({
						height: '0px',
						width: '0px'
					}, 500, function() {
						$("#_close").hide(500);
						$("#login_container").hide(500);
						$("#regist_container").hide(500);
						$("#_start").animate({
							left: '0px',
							height: '0px',
							width: '0px'
						}, 500);
					});
				});
				//去 注册
				$("#toRegist").click(function(){
					$("#login_container").hide(500);
					$("#regist_container").show(500);
				});
				//去 登录
				$("#toLogin").click(function(){
					$("#regist_container").hide(500);
					$("#login_container").show(500);
				});
			});
		</script>
<!-- 		<script>
			jQuery(document).ready(function($){
				$('#etalage').etalage({
					thumb_image_width: 300,
					thumb_image_height: 400,
					source_image_width: 800,
					source_image_height: 1000,
					show_hint: true,
					click_callback: function(image_anchor, instance_id){
						alert('Callback example:\nYou clicked on an image with the anchor: "'+image_anchor+'"\n(in Etalage instance: "'+instance_id+'")');
					}
				});

			});
		</script> -->
<!-- 自定义 -->
<script type="text/javascript">
	$(function(){
		showMovies(1);
		showMovies(2);
		getUser();
		userLogin();
		userRegist()
	});
	function getUser() {
		$.ajax({
			url:"user/getUser",
			type:"get",
			success:function(data){
				if(data!=""){
					$("#userLogin").css("display","none");
					$("#userMessage").css("display","block");
					var content = '<a href="info.html">'
						+'<img alt="" src="'+data.uimg+'" height="40px" style="border-radius: 50%;">&nbsp'
						+'<span style="color:black;" id="uname">'+data.uname+'</span>&nbsp&nbsp'
						+'</a>'
						+'<button type="button" class="btn btn-info" onclick="logout()" style="">注销</button>';
					$("#userMessage").html(content);
				}else{
					$("#userLogin").css("display","block");
					$("#userMessage").css("display","none");
				}
			}
		});
	}
	function logout(){
		$.ajax({
			url:"user/logout",
			type:"get",
			success:function(data){
				getUser();
			}
		});
	}
	function showMovies(currentPage){
		$.ajax({
			url:"/movie/showMovieByCount",
			type:"post",
			data:{
				currentPage:currentPage
			},
			success:function(data){
				for(var i = 0;i < data.movies.length;i++){
					var content = '<a href="cinema.html?mid='+data.movies[i].id+'">'
					+'<img src="'+data.movies[i].movieImgs[0].mimg+'" class="img-responsive" alt="">'
					+'<div class="biseller-name">'
					+'<h4>'+data.movies[i].mname+'</h4>'
					+'<button type="button" class="btn btn-danger">选座购票</button>'
					+'</a>'
					+'</div>';
					if(currentPage==1){
						$("#"+i).html(content);
					}else if(currentPage==2){
						$("#1"+i).html(content);
					}
				}
			}
		});
	}
	function userLogin(){
		$("#login_btn").click(function(){
			var IsBy = $.idcode.validateCode(); 
			var account= $("#login_number").val();
			var pass= $("#login_password").val();
			$.ajax({
				url : "/user/login",
				data:{account:account,
					pass:pass},
				type : "post",
				async:false,
				success : function(data) {
					getUser();
				}
			})
		});
	}
	//用户注册
	function userRegist(){
		$("#regist_btn").click(function(){
			var account= $("#regist_account").val();
			var pass= $("#regist_password2").val();
			var phone= $("#regist_phone").val();
			$.ajax({
				url : "/user/register",
				data:{account:account,
					pwd:pass,
					tel:phone},
				type : "post",
				async:false,
				success : function(data) {
					alert(data);
				}
			})
		});
	}
	// 	验证码
	function abc(){
		alert("发送验证码")
		var mobile= $("#regist_phone").val();
  code =Math.floor(Math.random()*(9999-1000))+1000;
//   var mobile ='15927492533';
  $.ajax({
   url:"http://smsapi.api51.cn/code/",
   type:"GET",
   data:{
    code:code,
    mobile:mobile
   },
   headers:{'Authorization':'APPCODE fb66c2e8c7584ccdbd00029cee448d3c'},
   beforedSend:function(xhr){
    xhr.setRequestHeader("Authorization","APPCODE fb66c2e8c7584ccdbd00029cee448d3c");
   },
   dataType:"json",
   success:function(data){
   }
  });
 }
</script>
	</head>
	<body>
		<!-- header -->
		<div style="height: 100px;">
		<div style="position: fixed;width: 100%;z-index: 999;">
		<div class="header">
			<div class="top_bg" style="background-color: white;">
				<div class="container">
					<div class="header_top">
						<div class="logo">
							<a href="index.html"><img src="images/logo.png" alt=""/><span>蜗牛影院</span></a>
						</div>
						<div class="top_right" style="margin-top: 0">
							<div id="userMessage" style="line-height: 45px;display: none;">
								<!-- <a href="info.html">
									<img alt="" src="images/aimg.jpg" height="40px" style="border-radius: 50%;" id="uimg">&nbsp
									<span style="color:black;" id="uname">1823342352323</span>
								</a>
								<button type="button" class="btn btn-info">注销</button> -->
							</div>
							<ul id="userLogin" style="line-height: 45px;display: none;">
								<li><button type="button" class="btn btn-info" id="Regist_start_">注册</button></li>|
								<li class="login">
									<div id="loginContainer"><button type="button" class="btn btn-info" id="Login_start_">登陆</button>
										<div id="loginBox">
											<form id="loginForm">
												<fieldset id="body">
													<fieldset>
														<label for="email">账号</label>
														<input type="text" name="email" id="email">
													</fieldset>
													<fieldset>
														<label for="password">密码</label>
														<input type="password" name="password" id="password">
													</fieldset>
													<input type="submit" id="login" value="登陆">
													<label for="checkbox"><input type="checkbox" id="checkbox"> <i>记住我</i></label>
												</fieldset>
												<span><a href="#">密码忘记了?</a></span>
											</form>
										</div>
									</div>
								</li>
								</ul>
						<!-- <div class="top_right">
							<ul>
								<li><a id="Login_start_" class="btn btn-info">登录</a></li>|
								<li><a id="Regist_start_" class="btn btn-success">注册</a></li>
							</ul>
						</div> -->
						<div class="clearfix"> </div>
					</div>
				</div>
			</div>
		</div>
		<div class="head-bann">
			<div class="container">
				<div class="head-nav">
					<span class="menu"></span>
					<ul class="megamenu skyblue">
						<li><a class="color1" href="index.html">首页</a></li>
						<li class="grid"><a class="color2" href="movies.html">影片</a></li>
						<li><a class="color4" href="cinema.html?mid=1">影院</a></li>
						<li><a class="color5" href="comment.html">评论</a></li>
						<div class="clearfix"> </div>
					</ul>
				</div>
			</div>
		</div>
						<div id='_start'>
			<div id='_close' style="display: none;">
				<span class="glyphicon glyphicon-remove"></span>
			</div>
			<br /> 
							<div id="login_container">
				<div id="lab1">
					<span id="lab_login">会员登录</span>
					<span id="lab_toRegist">
						&emsp;还没有账号&nbsp;
						<span id='toRegist' style="color: #EB9316;cursor: pointer;">立即注册</span>
					</span>
				</div>
				<div style="width:330px;">
					<span id="lab_type1">手机号/账号登陆</span>
				</div>
				<div id="form_container1">
					<br />
					<input type="text" class="form-control" placeholder="手机号/用户名" id="login_number" value="admin" />
					<input type="password" class="form-control" placeholder="密码" id="login_password" /><br />
					<div id="" style="margin-top: -30px;">
					<input type="text" id="Txtidcode" class="form-control" style="height: 39px; width: 110px; float: left;"/>
<!-- 					<input type="text" id="Txtidcode" class="txtVerification" style="height: 39px; width: 110px; float: left;"/> -->
					<span id="idcode"></span>
					</div>

		<!--<div>
			<button type="button" id="btns">验证</button>
		</div>-->
					<input type="button" style="float: right;" value="登录" class="btn btn-success" id="login_btn" />

				</div>

				<div style="display:block;width:330px;height：40px;">
					<span id="lab_type2">使用第三方直接登陆</span>
				</div>
				<div style="width:330px;height:100px;border-bottom: 1px solid #FFFFFF;">
					<br />
					<button id="login_QQ" type="button" class="btn btn-info">
						<img src="img/qq32.png" style="width:20px;margin-top:-4px;" />&emsp;QQ登录
					</button>
					<button id="login_WB" type="button" class="btn btn-danger">
						<img src="img/sina32.png" style="width:20px;margin-top:-4px;" />&emsp;微博登录
					</button>
				</div>
			</div>
				<!-- 会员注册 -->
			<div id='regist_container' style="display: none;">
				<div id="lab1">
					<span id="lab_login">会员注册</span>
					<span id="lab_toLogin">
						&emsp;已有账号&nbsp;
						<span id='toLogin' style="color: #EB9316;cursor: pointer;">立即登录</span>
					</span>
				</div>
				<div id="form_container2" style="padding-top: 25px;">
					
					<input type="text" class="form-control" value="admin"  placeholder="用户名" id="regist_account"/>
					<input type="password" class="form-control" placeholder="密码" id="regist_password1" />
					<input type="password" class="form-control" placeholder="确认密码" id="regist_password2" />
					<input type="text" class="form-control" placeholder="手机号" id="regist_phone" />
					<input type="text" class="form-control" placeholder="验证码" id="regist_vcode" />
					<!--<button id="getVCode" type="button" class="btn btn-success" >获取验证码</button>-->
					<input id="getVCode" type="button" class="btn btn-success" value="点击发送验证码" onclick="abc()" />

				</div>
				<input type="button" value="注册" class="btn btn-success" id="regist_btn" />
			</div>
		</div>
		</div>
		</div>
		<!-- script-for-nav -->
		<script>
			$("span.menu").click(function() {
				$(".head-nav ul").slideToggle(300, function() {
					// Animation complete.
				});
			});
		</script>
		<!-- script-for-nav -->
		<div class="banner">
			<div class="container">
				<div class="col-md-6">
				</div>
				<div class="clearfix"> </div>
			</div>
		</div>
		<!-- header -->
		<div class="instock">
			<div class="container">
				<a href="choice.html?mid=1&yid=3">
				<div class="col-md-6 chuk">

					<div class="blanc-info">
						
					</div>
				</div>
				</a>
				<a href="choice.html?mid=1&yid=1">
				<div class="col-md-6 blanc">

					<div class="blanc-info">
						
					</div>
				</div>
				</a>
				<div class="clearfix"> </div>
			</div>
		</div>
		<!-- instock -->
		<div class="featured">
			<div class="container">
				<div class="col-md-9">

					<div class="best-seller">

						<div class="biseller-info">
							<h3 class="new-models">正在热映</h3>
							<ul id="flexiselDemo1">
								<li>
									<div class="biseller-column1" id="0">
										<!-- <img src="images/ss6.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>狮子王</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="1">
										<!-- <img src="images/ss4.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>烈火英雄</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="2">
										<!-- <img src="images/ss5.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>速度与激情：特别行动</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="3">
										<!-- <img src="images/ss5.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>速度与激情：特别行动</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="4">
										<!-- <img src="images/ss5.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>速度与激情：特别行动</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="5">
										<!-- <img src="images/ss5.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>速度与激情：特别行动</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>

							</ul>
						</div>

					</div>
					<script type="text/javascript">
						$(function() {
							$("#flexiselDemo1").flexisel({
								visibleItems: 3,
								animationSpeed: 1000,
								autoPlay: true,
								autoPlaySpeed: 3000,
								pauseOnHover: true,
								enableResponsiveBreakpoints: true,
								responsiveBreakpoints: {
									portrait: {
										changePoint: 480,
										visibleItems: 1
									},
									landscape: {
										changePoint: 640,
										visibleItems: 2
									},
									tablet: {
										changePoint: 768,
										visibleItems: 3
									}
								}
							});

						});
					</script>
					<script type="text/javascript">
						$(function() {
							$("#flexiselDemo5").flexisel({
								visibleItems: 3,
								animationSpeed: 1000,
								autoPlay: true,
								autoPlaySpeed: 3000,
								pauseOnHover: true,
								enableResponsiveBreakpoints: true,
								responsiveBreakpoints: {
									portrait: {
										changePoint: 480,
										visibleItems: 1
									},
									landscape: {
										changePoint: 640,
										visibleItems: 2
									},
									tablet: {
										changePoint: 768,
										visibleItems: 3
									}
								}
							});

						});
					</script>
					<div class="best-seller">

						<div class="biseller-info">

							<ul id="flexiselDemo5">
								<li>
									<div class="biseller-column1" id="10">
										<!-- <img src="images/ss3.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>哪吒之魔童降世</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->
									</div>
								</li>
								<li>
									<div class="biseller-column1" id="11">
										<!-- <img src="images/ss1.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>中国机长</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="12">
										<!-- <img src="images/ss2.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>全职高手之巅峰荣耀</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="13">
										<!-- <img src="images/ss2.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>全职高手之巅峰荣耀</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="14">
										<!-- <img src="images/ss2.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>全职高手之巅峰荣耀</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>
								<li>
									<div class="biseller-column1" id="15">
										<!-- <img src="images/ss2.jpg" class="img-responsive" alt="">
										<div class="biseller-name">
											<h4>全职高手之巅峰荣耀</h4>
											<button type="button" class="btn btn-danger">选座购票</button>
										</div> -->

									</div>
								</li>

							</ul>
						</div>

					</div>
					<script type="text/javascript" src="js/jquery.flexisel.js"></script>
					
					<div class="biseller-info">
					
						<h3 class="new-models">即将上映</h3>
						<ul id="flexiselDemo3">
							<li>
								<div class="biseller-column">
									<img src="images/1.jpg" class="img-responsive" alt="" class="veiw-img">
									<div class="biseller-name">
										<h4>罗小黑战记</h4>
									</div>
					
								</div>
							</li>
							<li>
								<div class="biseller-column">
									<img src="images/2.jpg" class="img-responsive" alt="" class="veiw-img">
									<div class="biseller-name">
										<h4>逗爱熊仁镇</h4>
									</div>
					
								</div>
							</li>
					
							<li>
								<div class="biseller-column">
									<img src="images/3.jpg" class="img-responsive" alt="" class="veiw-img">
									<div class="biseller-name">
										<h4>一生只为一事来</h4>
									</div>
					
								</div>
							</li>
					
						</ul>
					
					</div>
					
					<script type="text/javascript">
					
						$(function() {
							$("#flexiselDemo3").flexisel({
								visibleItems: 3,
								animationSpeed: 1000,
								autoPlay: false,
								autoPlaySpeed: 3000,
								pauseOnHover: true,
								enableResponsiveBreakpoints: true,
								responsiveBreakpoints: {
									portrait: {
										changePoint: 480,
										visibleItems: 1
									},
									landscape: {
										changePoint: 640,
										visibleItems: 2
									},
									tablet: {
										changePoint: 768,
										visibleItems: 3
									}
								}
							});
					
						});
					</script>
					<script type="text/javascript" src="js/jquery.flexisel.js"></script>

					<div class="clearfix"></div>
				</div>
								<div class="col-md-3 span_1_of_right">
					<section class="sky-form">
						<div class="product_right">
							<h3 class="m_2">热门影片</h3>
							<a href="cinema.html?mid=1">
							<select class="dropdown" tabindex="10" data-settings='{"wrapperClass":"metro"}'>
								<option value="0">1.哪吒之魔童降世</option>
							</select>
							</a>
							<a href="cinema.html?mid=11">
							<select class="dropdown" tabindex="50" data-settings='{"wrapperClass":"metro"}'>
								<option value="1">2.中国机长</option>
							</select>
							</a>
							<a href="cinema.html?mid=13">
							<select class="dropdown" tabindex="8" data-settings='{"wrapperClass":"metro"}'>
								<option value="1">3.速度与激情：特别行动</option>
							</select>
							</a>
							<a href="cinema.html?mid=4">
							<select class="dropdown" tabindex="8" data-settings='{"wrapperClass":"metro"}'>
								<option value="1">4.烈火英雄</option>
							</select>
							</a>
						</div>

					</section>

					<div class="sellers">
						<h3 class="m_2">影片票房</h3>
						<div class="best">
							<div class="icon">
								<img src="images/sh1.jpg" class="img-responsive" alt="" />
							</div>
							<div class="data">
								<h4><a href="cinema.html?mid=13">速度与激情：特别行动</a></h4>
								<h5>696.76万</h5>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="best">
							<div class="icon">
								<img src="images/sh3.jpg" class="img-responsive" alt="" />
							</div>
							<div class="data">
								<h4><a href="cinema.html?mid=14">宝莱坞机器人2.0</a></h4>
								<h5>421.89万</h5>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="best">
							<div class="icon">
								<img src="images/sh2.jpg" class="img-responsive" alt="" />
							</div>
							<div class="data">
								<h4><a href="cinema.html?mid=1">哪吒之魔童降世</a></h4>
								<h5>354.85万</h5>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>

					<div class="sellers">
						<h3 class="m_2">热门影院</h3>
						<div class="tags">
							<ul>
								<li><a href="choice.html?mid=1&yid=3">1.万达影城</a></li><br/>
								<li><a href="choice.html?mid=1&yid=2">2.太平洋电影城</a></li><br/>
								<li><a href="choice.html?mid=1&yid=1">3.影立方773IMAX影城</a></li><br/>
								<li><a href="choice.html?mid=1&yid=4">4.大地影院</a></li><br/>
							</ul>
						</div>
					</div>

					<section class="sky-form">
						<div class="sellers">
							<h3 class="m_2">影片预告</h3>
							<section class="slider">
								<div class="flexslider">
									<ul class="slides">
										<li>
											<div class="tittle">
												<img src="images/s1.jpg" class="img-responsive" alt="" />
												<h6>诛仙Ⅰ</h6>
												<p>古装,爱情,奇幻</p>
												<p>中国大陆 / 101分钟</p>
												<p>2019-09-13 09:00大陆上映</p>
												<button type="button" class="btn btn-danger">预约订票</button>
											</div>
										</li>
										<li>
											<div class="tittle">
												<img src="images/s2.jpg" class="img-responsive" alt="" />
												<h6>攀登者</h6>
												<p>剧情,冒险</p>
												<p>中国大陆</p>
												<p>2019-09-30大陆上映</p>
												<button type="button" class="btn btn-danger">预约订票</button>
											</div>
										</li>
										<li>
											<div class="tittle">
												<img src="images/s3.jpg" class="img-responsive" alt="" />
												<h6>唐人街探案3</h6>
												<p>喜剧,动作,悬疑</p>
												<p>中国大陆 / 130分钟</p>
												<p>2020-01-25大陆上映</p>
												<button type="button" class="btn btn-danger">预约订票</button>
											</div>
										</li>
										<li>
											<div class="tittle">
												<img src="images/s4.jpg" class="img-responsive" alt="" />
												<h6>双子杀手</h6>
												<p>剧情,动作</p>
												<p>美国</p>
												<p>2019-10-18大陆上映</p>
												<button type="button" class="btn btn-danger">预约订票</button>
											</div>
										</li>
									</ul>
								</div>
							</section>

							<!-- FlexSlider -->
							<script defer src="js/jquery.flexslider.js"></script>
							<script type="text/javascript">
								$(function() {
									$('.flexslider').flexslider({
										animation: "slide",
										start: function(slider) {
											$('body').removeClass('loading');
										}
									});
								});
							</script>
							<!-- FlexSlider -->

						</div>
					</section>


				</div>
				<div class="clearfix"></div>
			</div>
		</div>
		<!-- footer -->
		<div class="footer">
			<div class="container">
				<p>Copyright &copy; 2015.Company name All rights reserved.</p>
			</div>
		</div>
		<!-- footer -->
		<script src="yzm/jquery.idcode.js"></script>
		
	<script type="text/javascript">
		var clock = '';
		var nums = 30;
		var btn;
		$(function(){
			$.idcode.setCode();
		})
/* 			$("#btns").click(function (){
				var IsBy = $.idcode.validateCode(); 
				alert(IsBy);
				console.log(IsBy);
			}); */
		function sendCode(thisBtn) {
			btn = thisBtn;
			btn.disabled = true; //将按钮置为不可点击
			btn.value = '重新获取（'+nums+'）';
			clock = setInterval(doLoop, 1000); //一秒执行一次
		}

		function doLoop() {
			nums--;
			if (nums > 0) {
				btn.value = '重新获取（'+nums+'）';
			} else {
				clearInterval(clock); //清除js定时器
				btn.disabled = false;
				btn.value = '点击发送验证码';
				nums = 10; //重置时间
			}
		}
		
		$(document).ready(function(){
			$("#login_QQ").click(function(){
				alert("暂停使用！");
			});
			$("#login_WB").click(function(){
				alert("暂停使用！");
			});
		});


	</script>
<!-- 	数据校验 -->
<!-- 		<div> -->
<!-- 			<button type="button" id="btns">验证</button> -->
<!-- 		</div> -->
	  <script type="text/javascript">
		       var validator = new Validator('example_form',[
      {
          //name 字段
          name: 'email',
          display:"你输入的不{{email}}是合法邮箱|不能为空|太长|太短",
          // 验证条件
          rules: 'is_emil|max_length(12)'
          // rules: 'valid_email|required|max_length(12)|min_length(2)'
      },{
          //name 字段
          name: 'sex',
          display:"请你选择性别{{sex}}",
          // 验证条件
          rules: 'required'
      }
    ],function(obj,evt){
        if(obj.errors){
            // 判断是否错误
        }
    })

</script>

	</body>
</html>
